<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <title>PtComGrid - Documentation</title>

    <script src="scripts/prettify/prettify.js"></script>
    <script src="scripts/prettify/lang-css.js"></script>
    <!--[if lt IE 9]>
      <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->
    <link type="text/css" rel="stylesheet" href="https://code.ionicframework.com/ionicons/2.0.1/css/ionicons.min.css">
    <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
    <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
</head>
<body>

<input type="checkbox" id="nav-trigger" class="nav-trigger" />
<label for="nav-trigger" class="navicon-button x">
  <div class="navicon"></div>
</label>

<label for="nav-trigger" class="overlay"></label>

<nav>
    <li class="nav-link nav-home-link"><a href="index.html">Home</a></li><li class="nav-heading">Modules</li><li class="nav-heading"><span class="nav-item-type type-module">M</span><span class="nav-item-name"><a href="module-orgselect.html">orgselect</a></span></li><li class="nav-heading"><span class="nav-item-type type-module">M</span><span class="nav-item-name"><a href="module-PtAside.html">PtAside</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-PtAside.html#~doFullScreen">doFullScreen</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-PtAside.html#~doShrink">doShrink</a></span></li><li class="nav-heading"><span class="nav-item-type type-module">M</span><span class="nav-item-name"><a href="module-PtBtn.html">PtBtn</a></span></li><li class="nav-heading"><span class="nav-item-type type-module">M</span><span class="nav-item-name"><a href="module-PtButton.html">PtButton</a></span></li><li class="nav-heading"><span class="nav-item-type type-module">M</span><span class="nav-item-name"><a href="module-PtComGrid.html">PtComGrid</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-PtComGrid.html#~doCopy%25E6%2594%25AF%25E6%258C%2581%25E6%25B7%25B1%25E5%25BA%25A6%25E5%25A4%258D%25E5%2588%25B6%25E5%25AF%25B9%25E8%25B1%25A1%25E4%25B8%25AD%25E5%25B5%258C%25E5%25A5%2597%25E5%25AF%25B9%25E8%25B1%25A1">doCopy 支持深度复制</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-PtComGrid.html#~doCancel%25E8%25A1%258C%25E5%2586%2585%25E7%25BC%2596%25E8%25BE%2591%25E5%258F%2596%25E6%25B6%2588">doCancel 行内编辑取消</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-PtComGrid.html#~doEdit%25E8%25A1%258C%25E5%2586%2585%25E7%25BC%2596%25E8%25BE%2591%25E5%25BC%2580%25E5%25A7%258B">doEdit 行内编辑开始</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-PtComGrid.html#~doQuery%25E6%259F%25A5%25E8%25AF%25A2">doQuery 查询</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-PtComGrid.html#~extSets">extSets</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-PtComGrid.html#~getCkRows%25E8%258E%25B7%25E5%258F%2596ck%25E9%2580%2589%25E4%25B8%25AD%25E7%259A%2584%25E8%25A1%258C">getCkRows 获取ck选中的行</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-PtComGrid.html#~removeHotKey%25E7%25A7%25BB%25E9%2599%25A4%25E5%25BF%25AB%25E6%258D%25B7%25E9%2594%25AE">removeHotKey 移除快捷键</a></span></li><li class="nav-heading"><span class="nav-item-type type-module">M</span><span class="nav-item-name"><a href="module-PtDialog.html">PtDialog</a></span></li><li class="nav-heading"><span class="nav-item-type type-module">M</span><span class="nav-item-name"><a href="module-PtDrop.html">PtDrop</a></span></li><li class="nav-heading"><span class="nav-item-type type-module">M</span><span class="nav-item-name"><a href="module-PtFileUpload.html">PtFileUpload</a></span></li><li class="nav-heading"><span class="nav-item-type type-module">M</span><span class="nav-item-name"><a href="module-PtFooter.html">PtFooter</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-PtFooter.html#~doShrink">doShrink</a></span></li><li class="nav-heading"><span class="nav-item-type type-module">M</span><span class="nav-item-name"><a href="module-PtForm.html">PtForm</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-PtForm.html#~add%25E5%25A2%259E%25E5%258A%25A0">add 增加</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-PtForm.html#~edit%25E7%25BC%2596%25E8%25BE%2591">edit 编辑</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-PtForm.html#~save%25E4%25BF%259D%25E5%25AD%2598,%25E5%25B9%25B6%25E8%25A7%25A6%25E5%258F%2591%25E4%25BA%258B%25E4%25BB%25B6saveCall(%25E6%2596%25B0%25E6%2595%25B0%25E6%258D%25AE,%25E6%2598%25AF%25E5%2590%25A6%25E6%2598%25AF%25E5%25A2%259E%25E5%258A%25A0),:this.$emit('saveCall',data.data,this.$attrs.model._isAdd),%25E5%25B9%25B6%25E8%25BF%2594%25E5%259B%259Epromise((%25E6%2596%25B0%25E6%2595%25B0%25E6%258D%25AE,%25E6%2598%25AF%25E5%2590%25A6%25E6%2598%25AF%25E5%25A2%259E%25E5%258A%25A0)">save  保存,并触发事件saveCall(新数据,是否是增加),:this.$emit('saveCall', data.data, this.$attrs.model._isAdd),
并返回promise((新数据,是否是增加)</a></span></li><li class="nav-heading"><span class="nav-item-type type-module">M</span><span class="nav-item-name"><a href="module-PtFormItem.html">PtFormItem</a></span></li><li class="nav-heading"><span class="nav-item-type type-module">M</span><span class="nav-item-name"><a href="module-PtGrid.html">PtGrid</a></span></li><li class="nav-heading"><span class="nav-item-type type-module">M</span><span class="nav-item-name"><a href="module-PtGridEditBtn.html">PtGridEditBtn</a></span></li><li class="nav-heading"><span class="nav-item-type type-module">M</span><span class="nav-item-name"><a href="module-PtGridSel.html">PtGridSel</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-PtGridSel.html#~%25E8%25A7%25A6%25E5%258F%2591rowClick(row)%25E4%25BA%258B%25E4%25BB%25B6">触发rowClick(row)事件</a></span></li><li class="nav-heading"><span class="nav-item-type type-module">M</span><span class="nav-item-name"><a href="module-PtHeader.html">PtHeader</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-PtHeader.html#~doShrink">doShrink</a></span></li><li class="nav-heading"><span class="nav-item-type type-module">M</span><span class="nav-item-name"><a href="module-PtMain.html">PtMain</a></span></li><li class="nav-heading"><span class="nav-item-type type-module">M</span><span class="nav-item-name"><a href="module-PtMessage.html">PtMessage</a></span></li><li class="nav-heading"><span class="nav-item-type type-module">M</span><span class="nav-item-name"><a href="module-PtNum.html">PtNum</a></span></li><li class="nav-heading"><span class="nav-item-type type-module">M</span><span class="nav-item-name"><a href="module-PtTableColumn.html">PtTableColumn</a></span></li><li class="nav-heading"><span class="nav-item-type type-module">M</span><span class="nav-item-name"><a href="module-PtTempSave.html">PtTempSave</a></span></li><li class="nav-heading"><span class="nav-item-type type-module">M</span><span class="nav-item-name"><a href="module-PtTree.html">PtTree</a></span></li><li class="nav-heading">Events</li><li class="nav-heading"><span class="nav-item-type type-event">E</span><span class="nav-item-name"><a href="module-PtFileUpload.html#~event:complete%25E6%2596%2587%25E4%25BB%25B6%25E5%2585%25A8%25E9%2583%25A8%25E4%25B8%258A%25E4%25BC%25A0%25E5%25AE%258C%25E7%25BB%2593%25E6%259D%259F%25E7%259A%2584%25E4%25BA%258B%25E4%25BB%25B6">complete 文件全部上传完结束的事件</a></span></li>
</nav>

<div id="main">
    
    <h1 class="page-title">PtComGrid</h1>
    

    




<section>

<header>
    
        
            
        
    
</header>

<article>
    <div class="container-overview">
    
        
            <div class="description">与springboot进行统一约定,封装了增删改查方法,导入导出excel,列表展示设置,pdf打印等功能,
默认增加创建人创建时间4个字段,默认开启checkbox和index列,checkbox支持数据驱动(属性为:_isCK),方法为getCkRows()(并非el-table-column的selection),
对el-table和el-pagination整合
pdf打印用的jspdf-autotable,是前端生成,带了5M的js字库(首次打开会慢,并且生僻字可能无法显示)
excel导入导出用的前端xlsx
布局的调整:PtComGrid默认为100%宽高,一个页面多个列表时,需要用pt-aside等布局处理
pt-table-column扩展el-table-column,行内编辑实现,增删改,为了用户体验,默认为当前数据的更新,不整个列表重新刷新(可在回调调用doQuery,但通常没必要)</div>
        

        
            
<div class="section-method">







<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    

    

    

    
</dl>























</div>
        
    
    </div>

    

    

    

     

    

    
        <h3 class="subsection-title">Members</h3>

        
            
<div class="section-members">
<h4 class="name" id=".props"><span class="type-signature">(static) </span>props<span class="type-signature"></span></h4>








    <h5 class="subsection-title">Properties:</h5>

    

<table class="props">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>imExcel</code></td>
            

            <td class="type">
            
                
<span class="param-type"><code>Boolean</code></span>


            
            </td>

            

            

            <td class="description last">是否可以导入excel 默认false</td>
        </tr>

        

    

        <tr>
            
                <td class="name"><code>ptQuery</code></td>
            

            <td class="type">
            
                
<span class="param-type"><code>Object</code></span>


            
            </td>

            

            

            <td class="description last">查询条件的封装对象,多以ptQuery.query.xx=xx调用</td>
        </tr>

        

    

        <tr>
            
                <td class="name"><code>notInit</code></td>
            

            <td class="type">
            
                
<span class="param-type"><code>Boolean</code></span>


            
            </td>

            

            

            <td class="description last">不立即执行查询,默认立即查询</td>
        </tr>

        

    

        <tr>
            
                <td class="name"><code>url</code></td>
            

            <td class="type">
            
                
<span class="param-type"><code>String</code></span>


            
            </td>

            

            

            <td class="description last">url前缀,遵循命名规范情况下,后面的findUrl,findOneUrl,saveUrl,saveAllUrl,removeUrl,removeAllUrl均可忽略</td>
        </tr>

        

    

        <tr>
            
                <td class="name"><code>findUrl</code></td>
            

            <td class="type">
            
                
<span class="param-type"><code>String</code></span>


            
            </td>

            

            

            <td class="description last">url后缀,列表查询,默认为find(PtQuery query)</td>
        </tr>

        

    

        <tr>
            
                <td class="name"><code>findOneUrl</code></td>
            

            <td class="type">
            
                
<span class="param-type"><code>String</code></span>


            
            </td>

            

            

            <td class="description last">单条编辑或者增加时用(增加在后台赋初值),默认为 findOne(PtQuery query)</td>
        </tr>

        

    

        <tr>
            
                <td class="name"><code>saveUrl</code></td>
            

            <td class="type">
            
                
<span class="param-type"><code>String</code></span>


            
            </td>

            

            

            <td class="description last">单条保存 save(Entity entity)</td>
        </tr>

        

    

        <tr>
            
                <td class="name"><code>saveAllUrl</code></td>
            

            <td class="type">
            
                
<span class="param-type"><code>String</code></span>


            
            </td>

            

            

            <td class="description last">批量保存 saveAll(List<Entity> entity)</td>
        </tr>

        

    

        <tr>
            
                <td class="name"><code>removeUrl</code></td>
            

            <td class="type">
            
                
<span class="param-type"><code>String</code></span>


            
            </td>

            

            

            <td class="description last">删除 remove(Entity entity)</td>
        </tr>

        

    

        <tr>
            
                <td class="name"><code>removeAllUrl</code></td>
            

            <td class="type">
            
                
<span class="param-type"><code>String</code></span>


            
            </td>

            

            

            <td class="description last">批量删除 removeAll(List<Entity> entity)</td>
        </tr>

        

    

        <tr>
            
                <td class="name"><code>imExcelUrl</code></td>
            

            <td class="type">
            
                
<span class="param-type"><code>String</code></span>


            
            </td>

            

            

            <td class="description last">导入 imExcel(List<Map> mapLs)</td>
        </tr>

        

    

        <tr>
            
                <td class="name"><code>height</code></td>
            

            <td class="type">
            
                
<span class="param-type"><code>String</code></span>


            
            </td>

            

            

            <td class="description last">高度,不建议用,请直接用布局文件的高度</td>
        </tr>

        

    

        <tr>
            
                <td class="name"><code>ptQuery</code></td>
            

            <td class="type">
            
                
<span class="param-type"><code>Object</code></span>


            
            </td>

            

            

            <td class="description last">!!!是查询最重要的封装,处理分页,查询条件,排序!!!!</td>
        </tr>

        

    

        <tr>
            
                <td class="name"><code>noSets</code></td>
            

            <td class="type">
            
                
<span class="param-type"><code>Boolean</code></span>


            
            </td>

            

            

            <td class="description last">不显示右上角的设置</td>
        </tr>

        

    

        <tr>
            
                <td class="name"><code>defaultSort</code></td>
            

            <td class="type">
            
                
<span class="param-type"><code>Object</code></span>


            
            </td>

            

            

            <td class="description last">(重要)继承PtGrid和ELementUi的Eltable,
排序默认按照updTime降序,如修改为sorter排序:defaultSort="{prop: 'sorter', order: 'ascending'}" ,
(后端jpql禁止直接拼jpql的order by,否则会影响表头排序)</td>
        </tr>

        

    

        <tr>
            
                <td class="name"><code>pageHide</code></td>
            

            <td class="type">
            
                
<span class="param-type"><code>boolean</code></span>


            
            </td>

            

            

            <td class="description last">是否隐藏分页</td>
        </tr>

        

    

        <tr>
            
                <td class="name"><code>ckHide</code></td>
            

            <td class="type">
            
                
<span class="param-type"><code>boolean</code></span>


            
            </td>

            

            

            <td class="description last">是否隐藏checkbox</td>
        </tr>

        

    

        <tr>
            
                <td class="name"><code>indexHide</code></td>
            

            <td class="type">
            
                
<span class="param-type"><code>boolean</code></span>


            
            </td>

            

            

            <td class="description last">是否隐藏 序号</td>
        </tr>

        

    

        <tr>
            
                <td class="name"><code>recHide</code></td>
            

            <td class="type">
            
                
<span class="param-type"><code>boolean</code></span>


            
            </td>

            

            

            <td class="description last">是否隐藏创建人4个字段</td>
        </tr>

        

    

        <tr>
            
                <td class="name"><code>pageSizes</code></td>
            

            <td class="type">
            
                
<span class="param-type"><code>String</code></span>


            
            </td>

            

            

            <td class="description last">每页分页,写法:pageSizes="[100,500,1000,5000,10000]"</td>
        </tr>

        

    

        <tr>
            
                <td class="name"><code>visualScroll:</code></td>
            

            <td class="type">
            
                
<span class="param-type"><code>boolean</code></span>


            
            </td>

            

            

            <td class="description last">开启虚拟滚动条,可大幅度提升页面容量(支持上万条列表)</td>
        </tr>

        

    
    </tbody>
</table>




<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    

    

    

    
</dl>







</div>

        
    

    
        <h3 class="subsection-title">Methods</h3>

        
            
<div class="section-method">

    

    <h4 class="name" id="~doCopy%E6%94%AF%E6%8C%81%E6%B7%B1%E5%BA%A6%E5%A4%8D%E5%88%B6%E5%AF%B9%E8%B1%A1%E4%B8%AD%E5%B5%8C%E5%A5%97%E5%AF%B9%E8%B1%A1"><span class="type-signature">(inner) </span>doCopy 支持深度复制<span class="signature">()</span><span class="type-signature"></span></h4>

    







<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    

    

    

    
</dl>























</div>
        
            
<div class="section-method">

    

    <h4 class="name" id="~doCancel%E8%A1%8C%E5%86%85%E7%BC%96%E8%BE%91%E5%8F%96%E6%B6%88"><span class="type-signature">(inner) </span>doCancel 行内编辑取消<span class="signature">()</span><span class="type-signature"></span></h4>

    







<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    

    

    

    
</dl>























</div>
        
            
<div class="section-method">

    

    <h4 class="name" id="~doEdit%E8%A1%8C%E5%86%85%E7%BC%96%E8%BE%91%E5%BC%80%E5%A7%8B"><span class="type-signature">(inner) </span>doEdit 行内编辑开始<span class="signature">(row)</span><span class="type-signature"></span></h4>

    







<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    

    

    

    
</dl>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        
        <th>Default</th>
        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>row</code></td>
            

            <td class="type">
            
                
<span class="param-type"><code>row</code></span>


            
            </td>

            

            
                <td class="default">
                
                    =''或null为增加,会从findOneUrl走后台查询,有值时,直接使用当前row
                
                </td>
            

            <td class="description last">
                
                
            </td>
        </tr>

    
    </tbody>
</table>
















</div>
        
            
<div class="section-method">

    

    <h4 class="name" id="~doQuery%E6%9F%A5%E8%AF%A2"><span class="type-signature">(inner) </span>doQuery 查询<span class="signature">(data!)</span><span class="type-signature"></span></h4>

    







<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    

    

    

    
</dl>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        
        <th>Default</th>
        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>data!</code></td>
            

            <td class="type">
            
                
<span class="param-type"><code>data</code></span>


            
            </td>

            

            
                <td class="default">
                
                    null,直接赋值,不走后台
                
                </td>
            

            <td class="description last">
                return promise 用于在查询后执行的事件
                
            </td>
        </tr>

    
    </tbody>
</table>
















</div>
        
            
<div class="section-method">

    

    <h4 class="name" id="~extSets"><span class="type-signature">(inner) </span>extSets<span class="signature">(command)</span><span class="type-signature"></span></h4>

    







<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    

    

    

    
</dl>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>command</code></td>
            

            <td class="type">
            
                
<span class="param-type"><code>String</code></span>


            
            </td>

            

            

            <td class="description last">
                设置项的执行,可通过slot=extSets扩展自己的设置
触发事件extSets(command)
                
            </td>
        </tr>

    
    </tbody>
</table>
















</div>
        
            
<div class="section-method">

    

    <h4 class="name" id="~getCkRows%E8%8E%B7%E5%8F%96ck%E9%80%89%E4%B8%AD%E7%9A%84%E8%A1%8C"><span class="type-signature">(inner) </span>getCkRows 获取ck选中的行<span class="signature">()</span><span class="type-signature"></span></h4>

    







<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    

    

    

    
</dl>























</div>
        
            
<div class="section-method">

    

    <h4 class="name" id="~removeHotKey%E7%A7%BB%E9%99%A4%E5%BF%AB%E6%8D%B7%E9%94%AE"><span class="type-signature">(inner) </span>removeHotKey 移除快捷键<span class="signature">()</span><span class="type-signature"></span></h4>

    







<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    

    

    

    
</dl>























</div>
        
    

    

    
</article>

</section>




</div>

<br class="clear">

<footer>
    Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Mon May 27 2019 16:11:56 GMT+0800 (中国标准时间) using the Minami theme.
</footer>

<script>prettyPrint();</script>
<script src="scripts/linenumber.js"></script>
</body>
</html>